\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller}{\section{Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller Class Reference}
\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller}\index{Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller@{Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller}}
}


The main controller for the Political Classifier M\-V\-C application.  


Inheritance diagram for Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a2318d1f1943edbad2e20ff5378dc13f0}{Load\-File} ()
\begin{DoxyCompactList}\small\item\em Displays the Load\-File view. \end{DoxyCompactList}\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_aeb14a2ed81250eb1fd2dec463993ba00}{Load\-File} (\hyperlink{class_political_classifier_1_1_web_1_1_models_1_1_load_file_view_model}{Load\-File\-View\-Model} model)
\begin{DoxyCompactList}\small\item\em Displays the Load\-File view with errors, or redirects to Display\-Results. \end{DoxyCompactList}\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a19bcc444550bbd3f60bdda2df2c01c7d}{File\-Too\-Big} ()
\begin{DoxyCompactList}\small\item\em Displays a message that the uploaded file was too large on the Load\-File view. \end{DoxyCompactList}\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_ad299f9232a20f55b2a245d7378a64e44}{Display\-Results} ()
\begin{DoxyCompactList}\small\item\em Displays the Display\-Results view for collecting simulation settings. \end{DoxyCompactList}\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_acd854fb463ca59c4543d7ced77913fd2}{Display\-Results} (\hyperlink{class_political_classifier_1_1_web_1_1_models_1_1_display_results_view_model}{Display\-Results\-View\-Model} model)
\begin{DoxyCompactList}\small\item\em Displays the Display\-Results view for collecting simulation settings. \end{DoxyCompactList}\item 
Action\-Result \hyperlink{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a799b80a0631ace186a54decc41d6c7b6}{Display\-Plot} ()
\begin{DoxyCompactList}\small\item\em Generates a graphical plot image. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The main controller for the Political Classifier M\-V\-C application. 

This controller controls the main flow of the Political Classifier M\-V\-C application. The primary control flow is as follows\-:


\begin{DoxyEnumerate}
\item Display the Load\-File view for uploading a data file.  
\item Display the blank Display\-Results view for setting simulation weights and parties.  
\item Display the Display\-Results view with the current simulation settings and the results of the simulation.  
\end{DoxyEnumerate}

\subsection{Member Function Documentation}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a799b80a0631ace186a54decc41d6c7b6}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!Display\-Plot@{Display\-Plot}}
\index{Display\-Plot@{Display\-Plot}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{Display\-Plot}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Display\-Plot (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a799b80a0631ace186a54decc41d6c7b6}


Generates a graphical plot image. 

Preconditions\-:


\begin{DoxyItemize}
\item Data file has been uploaded to server.  
\item Political\-Classifier\-Modeler has been stored in the Session object with the key {\ttfamily Modeler}.  
\item Simulation weights have been set in Political\-Classifier\-Modeler.  
\item Simulation has been run using Political\-Classifier\-Modeler.  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item Data file remains stored on server.  
\item The Political\-Classifier\-Modeler remains stored in the Session object with the key {\ttfamily Modeler}.  
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
A System.\-Web.\-Mvc.\-File\-Content\-Result object containing the binary data for the plotted graph image.
\end{DoxyReturn}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_ad299f9232a20f55b2a245d7378a64e44}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!Display\-Results@{Display\-Results}}
\index{Display\-Results@{Display\-Results}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{Display\-Results}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Display\-Results (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_ad299f9232a20f55b2a245d7378a64e44}


Displays the Display\-Results view for collecting simulation settings. 

This action expects the Political\-Classifier\-Modeler to be stored in the Session. If the Political\-Classifier\-Modeler is not found in the Session, the user is shown the Load\-File view along with a message indicating that his session had expired.

If the Political\-Classifier\-Modeler is found in the Session, this action displays a view that allows the user to set voter attribute weights and party coordinates for the simulation. This view will also display any warning messages concerning the processing of the data file, such as discarded rows. The view is bound to a Display\-Results\-View\-Model for transfering the simulation settings.

Preconditions\-:


\begin{DoxyItemize}
\item Data file is stored on server.  
\item The data file is loaded and processed by the Political\-Classifier\-Modeler.  
\item The Political\-Classifier\-Modeler is stored in the Session under the key {\ttfamily Modeler}.  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item Data file is still stored on server.  
\item The Political\-Classifier\-Modeler is still stored in the Session under the key {\ttfamily Modeler}.  
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
The Display\-Results view.
\end{DoxyReturn}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_acd854fb463ca59c4543d7ced77913fd2}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!Display\-Results@{Display\-Results}}
\index{Display\-Results@{Display\-Results}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{Display\-Results}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Display\-Results (
\begin{DoxyParamCaption}
\item[{{\bf Display\-Results\-View\-Model}}]{model}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_acd854fb463ca59c4543d7ced77913fd2}


Displays the Display\-Results view for collecting simulation settings. 

This action expects the Political\-Classifier\-Modeler to be stored in the Session. If the Political\-Classifier\-Modeler is not found in the Session, the user is shown the Load\-File view along with a message indicating that his session had expired.

If the Political\-Classifier\-Modeler is found in the Session, this action displays a view that allows the user to set voter attribute weights and party coordinates for the simulation. This view will also display the results of a successfully run simulation or any errors in the submitted simulation settings. The view is bound to a Display\-Results\-View\-Model for transfering the simulation settings and results.

Preconditions\-:


\begin{DoxyItemize}
\item Data file is stored on server.  
\item The data file is loaded and processed by the Political\-Classifier\-Modeler.  
\item The Political\-Classifier\-Modeler is stored in the Session under the key {\ttfamily Modeler}.  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item Data file is still stored on server.  
\item The Political\-Classifier\-Modeler is still stored in the Session under the key {\ttfamily Modeler}.  
\item Simulation weights have been set in Political\-Classifier\-Modeler.  
\item Simulation parties have been set in Political\-Classifier\-Modeler.  
\item Simulation has been run using Political\-Classifier\-Modeler.  
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em model} & A Display\-Results\-View\-Model containing the simulation settings.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The Display\-Results view.
\end{DoxyReturn}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a19bcc444550bbd3f60bdda2df2c01c7d}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!File\-Too\-Big@{File\-Too\-Big}}
\index{File\-Too\-Big@{File\-Too\-Big}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{File\-Too\-Big}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-File\-Too\-Big (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a19bcc444550bbd3f60bdda2df2c01c7d}


Displays a message that the uploaded file was too large on the Load\-File view. 

If the user attempts to upload a file that is larger than the request length limit, an exception is thrown. The application then discards this exception and transfers execution into this action. This action re-\/displays the Load\-File view to the user, along with a message indicating that the previously posted file was too large.

Preconditions\-:


\begin{DoxyItemize}
\item None  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item None  
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
The Load\-File view.
\end{DoxyReturn}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a2318d1f1943edbad2e20ff5378dc13f0}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!Load\-File@{Load\-File}}
\index{Load\-File@{Load\-File}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{Load\-File}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Load\-File (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_a2318d1f1943edbad2e20ff5378dc13f0}


Displays the Load\-File view. 

This action displays a view that allows the user to choose a data file on his local machine to upload to the server. The view is bound to a Load\-File\-View\-Model for uploading the data file.

Preconditions\-:


\begin{DoxyItemize}
\item None  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item None  
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
The Load\-File view.
\end{DoxyReturn}
\hypertarget{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_aeb14a2ed81250eb1fd2dec463993ba00}{\index{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}!Load\-File@{Load\-File}}
\index{Load\-File@{Load\-File}!PoliticalClassifier::Web::Controllers::MainController@{Political\-Classifier\-::\-Web\-::\-Controllers\-::\-Main\-Controller}}
\subsubsection[{Load\-File}]{\setlength{\rightskip}{0pt plus 5cm}Action\-Result Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Load\-File (
\begin{DoxyParamCaption}
\item[{{\bf Load\-File\-View\-Model}}]{model}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller_aeb14a2ed81250eb1fd2dec463993ba00}


Displays the Load\-File view with errors, or redirects to Display\-Results. 

This action validates and processes the posted data file. If there are any errors in the data file, the Load\-File view is redisplayed with a list of all errors. If the data file is error-\/free, the user is redirected to M\-:\-Political\-Classifier.\-Web.\-Controllers.\-Main\-Controller.\-Display\-Results.

Preconditions\-:


\begin{DoxyItemize}
\item None  
\end{DoxyItemize}

Postconditions\-:


\begin{DoxyItemize}
\item Data file is stored on server.  
\item A Political\-Classifier\-Modeler is created for running the simulation.  
\item The data file is loaded and processed by the Political\-Classifier\-Modeler.  
\item The Political\-Classifier\-Modeler is stored in the Session under the key {\ttfamily Modeler}.  
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em model} & A Load\-File\-View\-Model with the posted file.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The Load\-File view or a redirect to Display\-Results.
\end{DoxyReturn}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
C\-:/\-Users/\-Jonathan.\-De\-Carlo/\-Source/\-Repos/\-Political\-Classifier/src/\-Political\-Classifier.\-Web/\-Controllers/Main\-Controller.\-cs\end{DoxyCompactItemize}
